package com.jinzecloud.reportapproval.controller;

import java.util.Arrays;
import java.util.Map;

//import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.jinzecloud.reportapproval.bean.ProductSpecificationInfo;
import com.jinzecloud.reportapproval.service.ProductSpecificationInfoService;
import com.jinzecloud.reportapproval.utils.PageUtils;
import com.jinzecloud.reportapproval.utils.R;



/**
 * 产品规格明细表
 *
 * @author æ­å°
 * @email 1971240051@qq.com
 * @date 2024-12-03 16:18:45
 */
@RestController
@RequestMapping("reportapproval/productspecificationinfo")
public class ProductSpecificationInfoController {
    @Autowired
    private ProductSpecificationInfoService productSpecificationInfoService;

    /**
     * 列表
     */
    @RequestMapping("/list")
    //@RequiresPermissions("reportapproval:productspecificationinfo:list")
    public R list(@RequestParam Map<String, Object> params){
        PageUtils page = productSpecificationInfoService.queryPage(params);

        return R.ok().put("page", page);
    }


    /**
     * 信息
     */
    @RequestMapping("/info/{id}")
    //@RequiresPermissions("reportapproval:productspecificationinfo:info")
    public R info(@PathVariable("id") Integer id){
		ProductSpecificationInfo productSpecificationInfo = productSpecificationInfoService.getById(id);

        return R.ok().put("productSpecificationInfo", productSpecificationInfo);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    //@RequiresPermissions("reportapproval:productspecificationinfo:save")
    public R save(@RequestBody ProductSpecificationInfo productSpecificationInfo){
		productSpecificationInfoService.save(productSpecificationInfo);

        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    //@RequiresPermissions("reportapproval:productspecificationinfo:update")
    public R update(@RequestBody ProductSpecificationInfo productSpecificationInfo){
		productSpecificationInfoService.updateById(productSpecificationInfo);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    //@RequiresPermissions("reportapproval:productspecificationinfo:delete")
    public R delete(@RequestBody Integer[] ids){
		productSpecificationInfoService.removeByIds(Arrays.asList(ids));

        return R.ok();
    }

}
